package com.fbee.smartcommunities.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fbee.smartcommunities.entity.Goods;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fbee.smartcommunities.entity.User;
import com.fbee.smartcommunities.vo.ResultVO;
import com.sun.org.apache.xpath.internal.operations.Bool;
import io.minio.errors.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.List;

/**
 * <p>
 * 商品 服务类
 * </p>
 *
 * @author 汪佳泉
 * @since 2024-08-16
 */
public interface GoodsService extends IService<Goods> {

    Page<Goods> getTargetList(Integer pageNo, Integer pageSize, String keyword, Integer categoryId);

    Page<Goods> getBusinessPage(Integer pageNo, Integer pageSize,Integer stateUser,Long openId, String sortType, String sortDetail,Integer typeId,String goodsName);

    Page<Goods> getPage(Integer pageNo, Integer pageSize);

    Boolean fixState(Long id, Boolean state,String key);

    Goods getById(Long id);

    Boolean increaseBrowse(Long id);

    Boolean updateStateUserForBatch(Integer[] ids,Long stateUser);

    Boolean updateGoods(Long id,
                        String name,
                        String description,
                        Double discount,
                        Double price,
                        Integer store,
                        MultipartFile file) throws ServerException, InsufficientDataException, ErrorResponseException, IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException;

    Boolean addGoods(Long categoryId,String name,Integer count,String description,Double price,MultipartFile file,Long openId) throws ServerException, InsufficientDataException, ErrorResponseException, IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException;

    List<Integer> getGoodsStore(Long[] ids);

}
